@isTest
private class FWOAWorkFlowWebServiceTest {
	
     @isTest static  void testMethod1() {
        
          webservicesWorkflowWeaver.WorkflowRequestInfo  wk = new webservicesWorkflowWeaver.WorkflowRequestInfo ();
          wk.requestName = '与的销售合同审批';
          wk.requestLevel = '0';
          wk.creatorId = '11';
            //流程基础信息
          webservicesWorkflowWeaver.WorkflowBaseInfo wbf = new webservicesWorkflowWeaver.WorkflowBaseInfo();
          wbf.workflowId = '385';
          wbf.workflowName = '销售合同';
          wbf.workflowTypeName = '销售合同';
          wk.workflowBaseInfo = wbf;
          webservicesWorkflowWeaver.WorkflowMainTableInfo wmtf = new webservicesWorkflowWeaver.WorkflowMainTableInfo();
        	Map<String,String>mainMap = new Map<String,String>();
           mainMap.put('htsplx','0');//合同类型
           Map<String,String>detailMap = new Map<String,String>();
           detailMap.put('htxdf','sss');

        //主表字段
          webservicesWorkflowWeaver.WorkflowRequestTableField[] wrtfs = genTableField(mainMap);

        //明细表字段
          webservicesWorkflowWeaver.WorkflowRequestTableField[] wrtfs_dt = genTableField(detailMap);

         webservicesWorkflowWeaver.WorkflowDetailTableInfo wfdti = new webservicesWorkflowWeaver.WorkflowDetailTableInfo();

          webservicesWorkflowWeaver.ArrayOfWorkflowRequestTableField awrtf = new webservicesWorkflowWeaver.ArrayOfWorkflowRequestTableField();
          awrtf.WorkflowRequestTableField = wrtfs;

          webservicesWorkflowWeaver.WorkflowRequestTableRecord wrtr= new webservicesWorkflowWeaver.WorkflowRequestTableRecord();
          wrtr.workflowRequestTableFields = awrtf;
          
          webservicesWorkflowWeaver.WorkflowRequestTableRecord[] wrtrs = new List<webservicesWorkflowWeaver.WorkflowRequestTableRecord>();
          wrtrs.add(wrtr);

          webservicesWorkflowWeaver.ArrayOfWorkflowRequestTableRecord awrtr = new webservicesWorkflowWeaver.ArrayOfWorkflowRequestTableRecord();
          awrtr.WorkflowRequestTableRecord =  wrtrs;

          wmtf.requestRecords = awrtr;
          wk.workflowMainTableInfo = wmtf;

          webservicesWorkflowWeaver.ArrayOfWorkflowRequestTableField awrtfdt = new webservicesWorkflowWeaver.ArrayOfWorkflowRequestTableField();
          awrtfdt.WorkflowRequestTableField = wrtfs_dt;

          webservicesWorkflowWeaver.WorkflowRequestTableRecord wrtrdt= new webservicesWorkflowWeaver.WorkflowRequestTableRecord();
          wrtrdt.workflowRequestTableFields = awrtfdt;

          webservicesWorkflowWeaver.WorkflowRequestTableRecord[] wrtrsdi = new List<webservicesWorkflowWeaver.WorkflowRequestTableRecord>();
          wrtrsdi.add(wrtrdt);

          webservicesWorkflowWeaver.ArrayOfWorkflowRequestTableRecord  awrtrdi = new webservicesWorkflowWeaver.ArrayOfWorkflowRequestTableRecord();
          awrtrdi.WorkflowRequestTableRecord = wrtrsdi;

          wfdti.workflowRequestTableRecords =  awrtrdi;

          webservicesWorkflowWeaver.WorkflowDetailTableInfo[]  wfdtis = new List<webservicesWorkflowWeaver.WorkflowDetailTableInfo>();
          wfdtis.add(wfdti);

          webservicesWorkflowWeaver.ArrayOfWorkflowDetailTableInfo  awdti = new webservicesWorkflowWeaver.ArrayOfWorkflowDetailTableInfo();
          awdti.WorkflowDetailTableInfo = wfdtis;

          wk.workflowDetailTableInfos = awdti;

          String  requestId = '';
          webservicesServicesWeaverComCn.WorkflowServiceHttpPort wsh = new webservicesServicesWeaverComCn.WorkflowServiceHttpPort();
          webservicesWorkflowWeaver.ArrayOfWorkflowRequestLog awr = new webservicesWorkflowWeaver.ArrayOfWorkflowRequestLog();
          webservicesWorkflowWeaver.WorkflowRequestLog[]  wrls = new  List<webservicesWorkflowWeaver.WorkflowRequestLog>();

          webservicesWorkflowWeaver.WorkflowRequestLog  wrl = new  webservicesWorkflowWeaver.WorkflowRequestLog();
          wrls.add(wrl);
          awr.WorkflowRequestLog = wrls ;
          wk.workflowRequestLogs = awr ;

          Test.setMock(WebServiceMock.class, new FWOAWorkFlowWebserviceMockImpl());
          wsh.DoCreateWorkflowRequest(wk,Integer.valueOf('1234'));
                      
    }
     private static webservicesWorkflowWeaver.WorkflowRequestTableField[] genTableField(Map<String,String> tMap ){
       webservicesWorkflowWeaver.WorkflowRequestTableField[] wrtfs = new List<webservicesWorkflowWeaver.WorkflowRequestTableField>();

       for (String key : tMap.keySet() ) {
          webservicesWorkflowWeaver.WorkflowRequestTableField wrtf0 = new webservicesWorkflowWeaver.WorkflowRequestTableField();
          wrtf0.fieldName = key;
          wrtf0.fieldValue = tMap.get(key);
          wrtf0.edit = true;
          wrtf0.view = true;
          wrtfs.add(wrtf0);
       }
       return wrtfs;
    }


}